#ifndef __TERRAIN_RAYCAST_RESULT_HPP__
#define __TERRAIN_RAYCAST_RESULT_HPP__

#include "CellFace.h"
#include "Engine/Vector3.hpp"
#include "Engine/Ray3.h"

using namespace PocketSurvival::Engine;

namespace PocketSurvival
{
    struct TerrainRaycastResult
    {
		Ray3 ray;
		int32_t value;
		CellFace cellFace;
		int32_t collisionBoxIndex;
		float distance;

		inline Vector3 hitPoint(float offsetFromSurface = 0.0f) const
		{
			return ray.Position + ray.Direction * distance + CellFace::FaceToVector3(cellFace.face) * offsetFromSurface;
		}
    };
} // namespace PocketSurvival

#endif